package me.zhengjie.modules.website.repository;

import me.zhengjie.modules.website.domain.ReservationDetailTable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

/**
 * @author system
 * @since 2024-10-23 22:22:57
 *
 */
@Repository
public interface ReservationDetailTableRepository extends JpaRepository<ReservationDetailTable, Long>, JpaSpecificationExecutor<ReservationDetailTable> {

    /**
     * 根据预约访客表ID查询所有预约详情，并按预约时间升序排序（分页）
     *
     * @param reservationId 预约访客表ID
     * @param pageable 分页参数
     * @return Page<ReservationDetailTable> 分页查询结果
     */
    Page<ReservationDetailTable> findByReservationIdOrderByReservationTimeAsc(Integer reservationId, Pageable pageable);
}
